package com.yuanren.em.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.extension.activerecord.Model;

import java.util.Date;

@TableName("t_member_points")
public class MemberPoints extends Model<MemberPoints> {
    
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;
    
    private Long userId;
    
    private Integer pointsChange;
    
    private Integer pointsBalance;
    
    private String changeType;
    
    private Long relatedId;
    
    private String description;
    
    private Date createTime;
    
    private Date expireTime;
    
    private Boolean isExpired;
    
    // 关联字段，不在数据库中存储
    @TableField(exist = false)
    private String userName;
    
    @TableField(exist = false)
    private String userNickname;

    public MemberPoints() {}

    public MemberPoints(Long userId, Integer pointsChange, Integer pointsBalance, String changeType, String description) {
        this.userId = userId;
        this.pointsChange = pointsChange;
        this.pointsBalance = pointsBalance;
        this.changeType = changeType;
        this.description = description;
        this.isExpired = false;
    }

    // Getters and Setters
    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Long getUserId() {
        return userId;
    }

    public void setUserId(Long userId) {
        this.userId = userId;
    }

    public Integer getPointsChange() {
        return pointsChange;
    }

    public void setPointsChange(Integer pointsChange) {
        this.pointsChange = pointsChange;
    }

    public Integer getPointsBalance() {
        return pointsBalance;
    }

    public void setPointsBalance(Integer pointsBalance) {
        this.pointsBalance = pointsBalance;
    }

    public String getChangeType() {
        return changeType;
    }

    public void setChangeType(String changeType) {
        this.changeType = changeType;
    }

    public Long getRelatedId() {
        return relatedId;
    }

    public void setRelatedId(Long relatedId) {
        this.relatedId = relatedId;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public Date getExpireTime() {
        return expireTime;
    }

    public void setExpireTime(Date expireTime) {
        this.expireTime = expireTime;
    }

    public Boolean getIsExpired() {
        return isExpired;
    }

    public void setIsExpired(Boolean isExpired) {
        this.isExpired = isExpired;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public String getUserNickname() {
        return userNickname;
    }

    public void setUserNickname(String userNickname) {
        this.userNickname = userNickname;
    }

    @Override
    public String toString() {
        return "MemberPoints{" +
                "id=" + id +
                ", userId=" + userId +
                ", pointsChange=" + pointsChange +
                ", pointsBalance=" + pointsBalance +
                ", changeType='" + changeType + '\'' +
                ", relatedId=" + relatedId +
                ", description='" + description + '\'' +
                ", createTime=" + createTime +
                ", expireTime=" + expireTime +
                ", isExpired=" + isExpired +
                ", userName='" + userName + '\'' +
                ", userNickname='" + userNickname + '\'' +
                '}';
    }
} 